Cosmetic: Avoid explicit state variables
authorMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 15:30:47 +0000 (10:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 17:32:57 +0000 (12:32 -0500)
Using the state of the context makes this more obviously correct.

gtk/gtkviewport.c

index 6b8ac24d1bf695101a3a10c1e61060da478f001e..93a1e9ed5a9f7f68a7258c5e7fdb5ce43fa4251c 100644 (file)
@@ -1016,7 +1016,6 @@ gtk_viewport_get_preferred_size (GtkWidget      *widget,
   GtkViewport *viewport = GTK_VIEWPORT (widget);
   GtkViewportPrivate *priv = viewport->priv;
   GtkStyleContext *context;
-  GtkStateFlags state;
   GtkBorder padding, border;
   GtkWidget *child;
   gint       child_min, child_nat;
@@ -1027,12 +1026,11 @@ gtk_viewport_get_preferred_size (GtkWidget      *widget,
   minimum = 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
   context = gtk_widget_get_style_context (GTK_WIDGET (widget));
-  state = gtk_widget_get_state_flags (GTK_WIDGET (widget));
-  gtk_style_context_get_padding (context, state, &padding);
+  gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
 
   if (priv->shadow_type != GTK_SHADOW_NONE)
     {
-      gtk_style_context_get_border (context, state, &border);
+      gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
 
       if (orientation == GTK_ORIENTATION_HORIZONTAL)
         {